/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package VectorMathTests;

import GameEngine.GameConstants.Modifier;
import GameEngine.Vector;
import LevelEditor.EditorFunctions;

/**
 * Tests for the validity of the vector math functions
 * @author jh20
 */
public class TestOne {

    public static void main(String[] args) {
        // basic
        Vector first = new Vector(1,0);
        Vector second = EditorFunctions.getVector(Modifier.DOWNRIGHT);
        Vector result = first.project(second);
        System.out.println("results : " + result.getX() + ", " + result.getY());
        System.out.println("should be : " + 0.5 + ", " + 0.5);
        System.out.println("==============================================");

        // non-unit vectors
        // non-positive vectors
        first = new Vector(2, 0);
        second = new Vector((float) Math.sqrt(3), (float) -1.0);
        result = first.project(second);
        System.out.println("results : " + result.getX() + ", " + result.getY());
        System.out.println("should be : " + 3.0/2 + ", " + -Math.sqrt(3.0)/2);
        System.out.println("==============================================");
    }

}
